#ifndef UI_COMMANDEDIT_H
#define UI_COMMANDEDIT_H

#include <qlineedit.h>
#include <qstringlist.h>
#include "gui_export.h"
//Added by qt3to4:
#include <QFocusEvent>
#include <QEvent>
#include <QKeyEvent>

/**
 * A command line edit with some typical console features 
 * (uparrow for the history, tab, ..).
 */
class GUI_EXPORT UI_CommandEdit: public QLineEdit {
    Q_OBJECT

public:
    UI_CommandEdit(QWidget* parent=0, const char* name=0);
    virtual ~UI_CommandEdit();

protected:
	virtual bool event(QEvent* e);
	virtual void keyPressEvent(QKeyEvent* e);
	virtual void focusInEvent(QFocusEvent *e);
	virtual void focusOutEvent(QFocusEvent *e);

signals:
	void tabPressed();
	void escape();
	void focusIn();
	void focusOut();

private:
	QStringList historyList;
	QStringList::Iterator it;
	bool acceptCoordinates;
};

#endif

